package com.xyy.saas.payment.job;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.xyy.elasticjob.client.annotation.ElasticJobConf;
import com.xyy.saas.payment.service.job.OrderJobService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;

/**
 *
 * 每1小时查询下各个状态
 * @author wangtianqi
 * @date 2019/11/20 14:42
 *
 */
@ElasticJobConf(name = "xyy.elastic.job.manage.CheckWxBusinessStatusJob", cron = "0 0 0/1 * * ?")
@Slf4j
public class CheckWxBusinessStatusJob implements SimpleJob {
    @Autowired
    private OrderJobService orderJobService;

    @Override
    public void execute(ShardingContext shardingContext) {
        String time = new Date().toString();
        orderJobService.checkWxBusinessStatus();
        String checkEndTime = new Date().toString();
        log.info("CheckWxBusinessStatusJob#execute shardingInfo:{}", "shardingContext = " + 0 + "method:  query refund orders" + ";start time :" + time + ";checkEndTime time :" + checkEndTime);
    }
}